package com.wzdigit.wms.basic.enums;

import java.util.HashMap;
import java.util.Map;

public enum SnScanTypeEnum {
    /**
     * SN
     */
    SELECT_SN(0, "单台扫描", "GdnType"),
    /**
     * 栈板
     */
    SELECT_PALLET(1, "整板扫描", "GdnType");
	
	/**
     * 枚举值
     */
    public Integer code;

    /**
     * 枚举名称
     */
    public String enumName;

    /**
     * 枚举实体类属性描述
     */
    public String description;
    
    SnScanTypeEnum(String enumName, String description) {
        this.enumName = enumName;
        this.description = description;
    }

    SnScanTypeEnum(Integer code, String enumName, String description) {
        this.code = code;
        this.enumName = enumName;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    
    public String getEnumName() {
        return enumName;
    }

    public void setEnumName(String enumName) {
        this.enumName = enumName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static SnScanTypeEnum getEnumByCode(Integer enumCode) {
        SnScanTypeEnum[] values = SnScanTypeEnum.values();
        SnScanTypeEnum samplingEnum = null;

        for (SnScanTypeEnum value : values) {
            if (value.getCode().equals(enumCode)) {
                samplingEnum = value;
            }
        }
        return samplingEnum;
    }

    public static Map<Integer, String> getEnumByDescription() {
        Map<Integer, String> enumMap = new HashMap<Integer, String>();
        SnScanTypeEnum[] values = SnScanTypeEnum.values();
        for (SnScanTypeEnum value : values) {
        	enumMap.put(value.getCode(), value.getEnumName());
        }
        return enumMap;
    }
}